#pragma once

namespace git
{

class RemoteTrackBranch;
class LocalBranch;

class Upstream
{
public:
    Upstream() {}

    Upstream(const Upstream &) = delete;

    Upstream(Upstream &&b);

    Upstream(RemoteTrackBranch &&remote);

    Upstream(LocalBranch &&local);

    ~Upstream();

    Upstream &operator=(const Upstream &) = delete;

    Upstream &operator=(Upstream &&b);

    operator bool() const {
        return remote_ || local_;
    }

    const RemoteTrackBranch *asRemoteTrackBranch() const {
        return remote_;
    }

    RemoteTrackBranch *asRemoteTrackBranch() {
        return remote_;
    }

    const LocalBranch *asLocalBranch() const {
        return local_;
    }

    LocalBranch *asLocalBranch() {
        return local_;
    }

private:
    RemoteTrackBranch *remote_ = nullptr;
    LocalBranch *local_ = nullptr;
};

} // namespace git
